package com.internetCafes.spms.web.certificate.common.cont;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 证书信息相关常数
 *
 * @author HHKJ-SERVER-ZJ 2022/6/14 16:38
 */
public class CertConst {

    /**
     * 证书状态
     */
    @Getter
    @AllArgsConstructor
    public enum Status {
        DELETE(-1, "删除"),
        NO_USE(0, "空闲"),
        BORROW_OUT(1, "挂出"),
        BORROW_IN_RETURN(2, "挂还"),
        BORROW_IN(3, "挂入"),
        BID_USED(21, "投标"),
        PROJECT_USED(22, "项目"),
        BID_SUCCESS(23, "中标"),
        OTHER_STATUS(24, "其他"),
        ;
        private Integer id;
        private String statusName;

        public static Status getById(Integer id) {
            for (Status status : values()) {
                if (status.getId().equals(id)) {
                    return status;
                }
            }
            return PROJECT_USED;
        }
    }
}
